Conversation
Introduces `@player-devtools/mcp` — a Model Context Protocol server that exposes Player runtime state (players, flows, data, logs, plugin data) as MCP tools queryable by AI agents (e.g. Claude). - Extract `useStateReducer` from `plugin/core` → `@player-devtools/utils` - Extract `createExtensionClient` pure factory from `useExtensionState` - Add `FlipperServerTransport` with auto-start headless `flipper-server` - Register 9 MCP tools: list_players, get_player_status, get_flow, get_data, get_logs, get_plugin_data, describe_plugin, select_player, invoke_action Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Messenger sequencing fixes (verified by isolated revert + regression tests): - Broadcasts (id === -1) no longer advance the receiver's messagesReceived; otherwise a following targeted message looked like a duplicate and was dropped. - Stop double-incrementing messagesSent in sendMessage — getTransactionID already stamps and increments it, so the second bump desynced ids and triggered spurious lost-event recovery. - Advance the plugin interaction cursor before processing so a synchronous re-entrant dispatch (SELECTED_PLAYER_CHANGE) doesn't reprocess the same interaction. MCP server: - invoke_action now addresses the resolved playerId via target so an explicit player isn't misrouted to the currently selected one; handleInteraction takes an optional target. - Migrate tools to a declarative ToolDef table registered via McpServer; share Zod input shapes across the player-scoped tools. - Refcount the shared flipper-server daemon across MCP processes; drop the unused WebSocketServerTransport. Add regression tests for messenger target routing, plugin re-entrancy, and invoke_action routing.
Add or rewrite READMEs across the devtools workspace, source-grounded and consolidated one-per-family (each covers all its platform packages — TS, JVM, Android, iOS, SwiftUI): - New: mcp, flipper-plugin, plugins/basic, types, utils - Rewritten: plugin and messenger families (messenger also fixes a stale API doc — removed a nonexistent `target` ctor option, added the required `logger`, fixed the import path) - Promote the devtools overview to the repo-root README (workspace map + architecture) and drop the nested devtools/README stub - client: drop the broken license badge and dangling external reference, add sibling cross-links Each README leads with installation (npm / Maven / SPM, plus `claude mcp add` for the MCP server) and links to siblings; all cross-links and anchors resolve.
- Add a consolidated README for the profiler plugin family (core, content, react, jvm, android, ios, swiftui), following the basic-plugin template, and list it in the root README. - Make the Maven group / Kotlin package convention consistent with basic: move the profiler Kotlin packages from com.intuit.playerui.plugins.devtools.profiler to com.intuit.playerui.devtools.plugins.profiler, and derive the Maven group from GROUP via "%s.plugins" % GROUP in both BUILD files. Update the Android manifest package and add an explicit R import so the rename compiles. - Declare a capabilities block on ProfilerPluginData (data keys + start/stop/ reset-profiling actions) so the profiler is discoverable via the MCP describe_plugin tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's changing
This PR adds an MCP server for agent-driven Player debugging, fixes a set of devtools messenger routing bugs that surface on that path, and documents the devtools workspace.
1.
@player-devtools/mcp— agent access to devtoolsA new MCP server that exposes the Player UI Devtools to AI agents (e.g. Claude) over stdio. It connects to live Players through a
flipper-serverand re-exposes them as MCP tools:list_players,get_player_status,get_flow,get_data,get_logs,get_plugin_data,describe_plugin,select_player, andinvoke_action.Transportinterface; the shippedFlipperServerTransportrefcounts a sharedflipper-serverdaemon across processes (first in starts it, last out tears it down) so multiple agent registrations don't each spawn or prematurely kill the server.player-devtools-mcpCLI; registers withclaude mcp add player-devtools -- npx -y @player-devtools/mcp@latest.2. Messenger routing fixes
Three sequencing bugs in
@player-devtools/messenger/ the core plugin that caused targeted messages to be dropped — exactly the traffic pattern the MCP server'sselect→invoke_actionflow produces. Each is covered by a regression test and was verified by reverting the fix in isolation:id === -1) no longer advance the receiver'smessagesReceived, which had made the next targeted message look like a duplicate and be dropped.sendMessageno longer double-incrementsmessagesSent(it was already stamped bygetTransactionID), which had desynced ids and triggered spurious lost-event recovery.SELECTED_PLAYER_CHANGE) doesn't reprocess the same interaction.invoke_actionalso now addresses the resolvedplayerIdviatarget, so an explicit player isn't misrouted to the currently-selected one.3. Documentation pass
READMEs across the devtools workspace, consolidated one-per-family (each covers all its platform packages — TS, JVM, Android, iOS, SwiftUI):
mcp,plugins/basic,plugins/profiler,types,utils.pluginandmessengerfamilies (messengeralso fixes stale API docs — removed a nonexistenttargetctor option, added the requiredlogger, fixed the import path).README; tidiedclient.claude mcp add).4. Profiler plugin consistency (alongside the new profiler plugin)
basic(com.intuit.playerui.devtools.plugins.*).capabilitiesdescriptor toProfilerPluginDataso the profiler is discoverable via the MCPdescribe_plugintool.Tests
invoke_actionrouting (unit + integration).Documentation
Change Type (required)
patchminormajorRelease Notes
Added
@player-devtools/mcp, an MCP server that exposes the Player UI Devtools to AI agents. Point an MCP client at it over stdio:It connects to live Players through a shared
flipper-serverand exposes tools to list players, read flow/data/logs/plugin state, and invoke plugin actions. Also includes messenger routing fixes for reliable targeted message delivery and README documentation across the devtools workspace.